package cn.zswltech.gruul.common.dal.dao;

import cn.zswltech.gruul.common.dal.tkmybatis.IMapper;
import cn.zswltech.gruul.common.entity.CustomTreeDO;
import cn.zswltech.gruul.common.entity.FunctionDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
@Mapper
public interface CustomTreeDOMapper extends IMapper<CustomTreeDO> {

    List<CustomTreeDO> queryCustomByOrgId(Long orgId);

    List<Map<String, Object>> queryMenuByOrgId(Long orgId);

    List<FunctionDO> queryFuncs(@Param("orgId") Long orgId);

    List<CustomTreeDO> queryCustomByOneLevelOrg();

    List<Map<String, Object>> queryMenuByOneLevelOrg();

    List<CustomTreeDO> queryCustomDOByParentId(Long id);

    CustomTreeDO queryById(Long id);

    /**
     * 根据functionId找到最低级分组
     * @param functionId
     * @return
     */
    CustomTreeDO queryCustomTreeByFunctionId(Long functionId);
}